<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/Public/web/css/pintuer.css">
    <link rel="stylesheet" href="/Public/web/css/admin.css">
    <script src="/Public/web/js/jquery.js"></script>
    <script src="/Public/web/js/pintuer.js"></script>
</head>


<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> <?php echo L("jiaohaochuli");?></strong></div>
    <table class="table table-hover text-center">
      <tr>
        <th width="10%"><?php echo L("haoshu");?></th>
        <th width="20%"><?php echo L("canzhuoleixing");?></th>
        <th width="10%"><?php echo L("caozuo");?></th>
      </tr>
      <?php if(is_array($info)): foreach($info as $key=>$v): ?><tr class="<?php echo ($v['id']); ?>">
          <td><?php echo ($v['get_num']); ?></td>
          <td><?php echo ($v['table_cate_name']); ?></td>
          <td>
            <div class="button-group">
              <?php if($v['status'] == 0): ?><span style="color: blue; cursor: pointer; text-decoration: underline;"
                      onclick="is_eat(<?php echo ($v['id']); ?>,this)"><?php echo L("daijiucan");?></span>
                <?php elseif($v['status'] == 1): ?>
                <span style="color: green;"><?php echo L("yijiucan");?></span><?php endif; ?>
            </div>
          </td>
        </tr><?php endforeach; endif; ?>
      <tr>
        <td colspan="10">
          <div class="pagelist"><?php echo ($show); ?></div>
        </td>
      </tr>
    </table>
  </div>
  <script type="text/javascript">
    function is_eat(id, t) {
      if (confirm("<?php echo L('gaiweijiucan');?>")) {
        var url = "<?php echo U('Getnum/is_eat');?>";
        $.getJSON(url, {id: id}, function (data) {
          if (data.result == 'yes') {
            var p = $(t).parent();
            $(t).remove();
            p.prepend('<span style="color: green;"><?php echo L("yijiucan");?></span>');
          }
        })
      }
    }
  </script>
</body>

</html>